<?php

class TestViewHandler implements Base\ViewHandler
{
    public $vars = array();
    public $result;
    
    function __construct( $tplName )
    {
        $this->name = $tplName;
        $this->result = new stdClass;
    }
    
    function assign( $name, $val )
    {
        $this->vars[$name] = $val;
    }
    
    function render()
    {
        $this->result->name = $this->name;
        $this->result->vars = $this->vars;
    }
    
    function getName() { return $this->name; }
    
    function getResult( $flag = TRUE ) { $this->render(); return $this->result; }
}
